/*
package com.wyq.jpa.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.wyq.jpa.model.Blog;
import com.wyq.jpa.service.BlogService;
import com.wyq.jpa.service.ShiroDbRealm.ShiroUser;

@RequestMapping(value="admin")
@Controller
public class BlogController {
	@Autowired
	private BlogService blogService;
	
	@RequestMapping(value="blogConfig")
	public ModelAndView getBlogConifg(){
		ModelAndView mav=new ModelAndView("admin/config/blogConfig");
		Subject subject = SecurityUtils.getSubject();
		ShiroUser user=(ShiroUser)subject.getPrincipal();
		Blog blog=blogService.findById(user.getId().intValue());
		mav.addObject("blog", blog);
		return mav;
	}
	@RequestMapping(value="blogUpdate")
	public ModelAndView updateBlog(Blog blog){
		ModelAndView mav=new ModelAndView("redirect:blogConfig");
		Subject subject = SecurityUtils.getSubject();
		ShiroUser user=(ShiroUser)subject.getPrincipal();
		blog.setId(user.getId().intValue());
		blogService.updateBlog(blog);
		return mav;
	}
}
*/
